using System;
using System.Web;
using System.Web.UI;
using ABasile;

namespace webpman
{	
	public class @updater : System.Web.UI.Page
	{
		// Cookies lists
		string[] CookiesName = new string[] {
			"lang",
			"place"			
		};

		
        protected void Page_Load(object sender, EventArgs e)
        {
        	
        	
        	// Update Cookies
        	HttpCookie myLangCookie;

        	for (int j=0; j<CookiesName.Length; j++)
        	{
        		if (Request.QueryString[CookiesName[j]] != null)
        		{
        			if (Request.QueryString[CookiesName[j]] != "")
        			{
        				myLangCookie = new HttpCookie(CookiesName[j]);
        				myLangCookie.Value = Request.QueryString[CookiesName[j]];
						myLangCookie.Expires = DateTime.Now.AddDays(365);
						Response.Cookies.Add(myLangCookie);
        			}
        		}        			
        	}

			// Trace...
			// ABasile.Utility Uman = new ABasile.Utility();
			// Uman.AppendTraceFile("updater.aspx.cs", "Page_Load", Request.QueryString["callpage"]);
			
        	// Return on web page
        	Response.Redirect(Request.QueryString["callpage"].Replace("_-_", "&") );
        	
        	
        	
        }	    
	}
}
